#!/usr/bin/python3

import time
import os

try:
    text = input("please input text:")
    if text == "":
        print ("please input some charactor,not empty")
    else:
        with open("aa.txt","a+") as f:
            f.write(text)
            print ("write success(aa.txt)")
except Exception as err:
    with open("/var/log/aa_log.txt","a+") as f1:
        user = os.getlogin()    
        text = "%s %s %s" % (time.ctime(),user,err)
        f1.write(text)
    print ("the err already write message(/var/log/aa_log.txt)")
